<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户信息管理</title>
    <script src="/script/jquery-3.4.1.min.js" type="text/javascript"></script>
    <script src="/bootstrap-3.4.1-dist/js/bootstrap.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/bootstrap-3.4.1-dist/css/bootstrap.css" type="text/css"/>
    <link href="/frame/index.css" rel="stylesheet" type="text/css">
    <script src="/frame/index.js"></script>

    <style>
        .right {
            padding: 5px;
        }

        .form_1 {
            margin-top: 30px;
            margin-left: 400px;
        }

    </style>
    <script type="text/javascript">
        $(function () {
            $('.submit_1').bind('click', function () {
                let password = $('#rpwd').val();
                if (password === null || password.trim() === '') {
                    $("#msg").text('新密码不能为空！')
                    return false
                }
            })
        })
    </script>
</head>
<body>
<!--第三部分-->
<div class="right">
    <table class="table table-hover">
        <thead>
        <tr class="info">
            <th>用户昵称</th>
            <th>账号</th>
            <th>密码</th>
            <th>日记个数</th>
            <th>分组个数</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:object="${user}">
            <td th:text="*{name}"></td>
            <td th:text="*{zid}"></td>
            <td th:text="*{password}"></td>
            <td th:text="*{dcount}"></td>
            <td th:text="*{gcount}"></td>
            <td width=>
                <button id="updateP" class="btn btn-danger">修改密码</button>
            </td>
        </tr>
        </tbody>
    </table>
</div>

<div class="main">
    <div class="form_1">
        <form action="/user/updateP" method="post">
            <div id="msg" style="color: orangered"></div>
            <div class="input_1">
                <div class="login_logo">修改密码</div>
                <div class="close">X</div>
            </div>
            <hr>
            <div class="input_1"><input id="rpwd" type="text" name="password" placeholder="&nbsp;请输入新密码"></div>
            <div class="input_1"><input class="submit_1" type="submit" value="修&nbsp;改"></div>
        </form>
    </div>
</div>

</body>
</html>
